<extend name="public@base"/>
block(name='main')
    .wrap
        ul.nav.nav-tabs(role="tablist")
            li.nav-item: a.nav-link(href="{:url('link/index')}") {:lang('ADMIN_LINK_INDEX')}
            li.nav-item: a.nav-link.active(href="{:url('link/add')}") {:lang('ADMIN_LINK_ADD')}

        form.form-horizontal.js-ajax-form.margin-top-20(method='post', action="{:url('link/addPost')}")
            fieldset
                .form-group.form-row
                    label.col-2.col-form-label.text-right(for='input-name')
                        | 名称
                        span.form-required
                    .col-10.col-lg-6
                        input#input-name.form-control(type='text', name='name')
                .form-group.form-row
                    label.col-2.col-form-label.text-right(for='input-url')
                        | 链接地址
                        span.form-required
                    .col-10.col-lg-6
                        input#input-url.form-control(type='text', name='url')
                .form-group.form-row
                    label.col-2.col-form-label.text-right(for='input-image') 图标
                    .col-10.col-lg-5
                        input#input-image.form-control(type='text', name='image')
                    .col-4.col-lg-1.align-self-center.offset-2.offset-lg-0
                        a.btn.btn-primary.btn-sm(href="javascript:uploadOneImage('图片上传','#input-image');") 上传图片
                .form-group.form-row
                    label.col-2.col-form-label.text-right(for='input-target') 打开方式
                    .col-10.col-lg-6
                        select#input-target.form-control(name='target')
                            <foreach name="targets" item="vo">
                            option(value='{$key}') {$vo}
                            </foreach>
                .form-group.form-row
                    label.col-2.col-form-label.text-right(for='input-description') 描述
                    .col-10.col-lg-6
                        textarea#input-description.form-control(name='description')
                .form-group.form-row
                    .col-auto.offset-2.btn-group
                        button.btn.btn-sm.btn-primary.js-ajax-submit(type='submit') {:lang('ADD')}
                        a.btn.btn-sm.btn-default.border(href='javascript:history.back(-1);') {:lang('BACK')}
